{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <!-- 表单头部 -->
                <div class="box-header with-border">
                    <div class="btn-group">
                        <a class="btn flat btn-sm btn-default BackButton">
                            <i class="fa fa-arrow-left"></i>
                            返回
                        </a>
                    </div>
                </div>
                <!-- 表单 -->
                <form id="dataForm" class="form-horizontal dataForm" action="" method="post"
                      enctype="multipart/form-data">
                    <!-- 表单字段区域 -->
                    <div class="box-body">
                        <div class="form-group">
                            <label style="width: 35%" for="circle_name" class="col-sm-2 control-label">圈层名称</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="circle_name" name="circle_name" value="{$data.circle_name|default=''}" placeholder="请输入圈层名称"
                                       type="text" class="form-control field-text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label style="width: 35%" for="circle_img" class="col-sm-2 control-label">圈层封面</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="circle_img" name="circle_img" placeholder="请上传圈层封面"
                                       data-initial-preview="{$data.circle_img|default=''}" type="file"
                                       class="form-control field-image">
                            </div>
                        </div>
                        <script>
                            $('#circle_img').fileinput({
                                language: 'zh',
                                overwriteInitial: true,
                                browseLabel: '浏览',
                                initialPreviewAsData: true,
                                dropZoneEnabled: false,
                                showUpload: false,
                                showRemove: false,
                                allowedFileTypes: ['image'],
                                maxFileSize: 10240,
                            });
                        </script>

                        <div class="form-group">
                            <label style="width: 35%" for="circle_color" class="col-sm-2 control-label">颜色编码</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="circle_color" name="circle_color" value="{$data.circle_color|default=''}" placeholder="请输入颜色编码"
                                       type="text" class="form-control field-text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label style="width: 35%" for="circle_url" class="col-sm-2 control-label">皇冠标志</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="circle_url" name="circle_url" placeholder="请上传皇冠标志"
                                       data-initial-preview="{$data.circle_url|default=''}" type="file"
                                       class="form-control field-image">
                            </div>
                        </div>
                        <script>
                            $('#circle_url').fileinput({
                                language: 'zh',
                                overwriteInitial: true,
                                browseLabel: '浏览',
                                initialPreviewAsData: true,
                                dropZoneEnabled: false,
                                showUpload: false,
                                showRemove: false,
                                allowedFileTypes: ['image'],
                                maxFileSize: 10240,
                            });
                        </script>

                        <div class="form-group">
                            <label style="width: 35%" for="circle_line" class="col-sm-2 control-label">红线金额<span style="color: red">（注释：车辆金额超过此金额，会到下一个圈层）</span></label>
                            <div class="col-sm-10 col-md-4">
                                <input id="circle_line" name="circle_line" value="{$data.circle_line|default=''}" placeholder="请输入红线金额"
                                       type="text" class="form-control field-text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label style="width: 35%" style="width: 35%" for="circle_text" class="col-sm-2 control-label">封面描述</label>
                            <div class="col-sm-10 col-md-4">
                                <textarea id="circle_text" name="circle_text" type="text/plain" style="height: 80px;width: 100%;">{$data.circle_text|raw|default=''}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label style="width: 35%" for="circle_content" class="col-sm-2 control-label">圈层通知</label>
                            <div class="col-sm-10 col-md-4">
                                <textarea id="circle_content" name="circle_content" type="text/plain" style="height: 80px;width: 100%;">{$data.circle_content|raw|default=''}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label style="width: 35%" for="circle_content" class="col-sm-2 control-label">状态</label>
                            <div class="col-sm-10 col-md-4">
                                <select name="circle_status" id="circle_status" class="form-control field-select">
                                    <option value="1" {if isset($data) && $data.circle_status==1}selected{/if}>正常</option>
                                    <option value="2" {if isset($data) && $data.circle_status==2}selected{/if}>隐藏</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label style="width: 35%" for="circle_pic" class="col-sm-2 control-label">群组头像</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="circle_pic" name="circle_pic" placeholder="请上传群组头像"
                                       data-initial-preview="{$data.circle_pic|default=''}" type="file"
                                       class="form-control field-image">
                            </div>
                        </div>
                        <script>
                            $('#circle_pic').fileinput({
                                language: 'zh',
                                overwriteInitial: true,
                                browseLabel: '浏览',
                                initialPreviewAsData: true,
                                dropZoneEnabled: false,
                                showUpload: false,
                                showRemove: false,
                                allowedFileTypes: ['image'],
                                maxFileSize: 10240,
                            });
                        </script>


                    </div>
                    <!-- 表单底部 -->
                    <div class="box-footer">
                        <div class="col-sm-2" style="width: 35%;">
                        </div>
                        <div class="col-sm-10 col-md-4">
                            <div class="btn-group">
                                <button type="submit" class="btn flat btn-info dataFormSubmit">
                                    确认编辑
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
<script>
    /** 表单验证 **/
    $('#dataForm').validate({
        rules: {
            'title': {
                required: true,
            },
            'detail': {
                required: true,
            },

        },
        messages: {
            'title': {
                required: "标题不能为空",
            },
            'detail': {
                required: "详情不能为空",
            },

        }
    });
</script>
{/block}